/**
 * Copyright (c) 2017 ShopJsp. All Rights Reserved.
 * ============================================================================
 * 版权所有 2011 - 今 北京华宇盈通科技有限公司，并保留所有权利。
 * ----------------------------------------------------------------------------
 * 提示：在未取得SHOPJSP商业授权之前，您不能将本软件应用于商业用途，否则SHOPJSP将保留追究的权力。
 * ----------------------------------------------------------------------------
 * 官方网站：http://www.shopjsp.com
 * ============================================================================
 * @author 张丁方
 * @CreateTime 2017-3-31 13:32:13
 */
package com.hyyt.shopjsp.order.service.imp;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import com.hyyt.shopjsp.order.dao.ShopOrdersOplogDAO;
import com.hyyt.shopjsp.order.pojo.ShopOrdersOplog;
import com.hyyt.shopjsp.order.service.IShopOrdersOplogService;

@Service
public class ShopOrdersOplogService implements IShopOrdersOplogService {
    private static  final Logger logger = Logger.getLogger(IShopOrdersOplogService.class);

    @Resource
    private ShopOrdersOplogDAO shopOrdersOPLogDAO;

    /**
     * 保存SHOP_订单日志
     *
     * @param shopOrdersOPLog SHOP_订单日志
     * @return 保存后的SHOP_订单日志
     */
    @Override
    public void saveShopOrdersOPLog(ShopOrdersOplog shopOrdersOPLog) {
        shopOrdersOPLogDAO.insert(shopOrdersOPLog);
    }

    /**
     * 更新SHOP_订单日志
     *
     * @param shopOrdersOPLog SHOP_订单日志
     * @return 更新后的SHOP_订单日志
     */
    @Override
    public void updateShopOrdersOPLog(ShopOrdersOplog shopOrdersOPLog) {
        shopOrdersOPLogDAO.update(shopOrdersOPLog);
    }

    /**
     * 删除指定ID的SHOP_订单日志
     *
     * @param id SHOP_订单日志ID
     */
    @Override
    public void deleteShopOrdersOPLog(Integer id) {
        shopOrdersOPLogDAO.delete(id);
    }

    /**
     * 删除指定ID集合的SHOP_订单日志
     *
     * @param ids SHOP_订单日志ID集合
    */
    public void deleteShopOrdersOPLog(Collection<Integer> ids){
        shopOrdersOPLogDAO.batchDelete(ids);
    }

    /**
     * 根据ID加载一个SHOP_订单日志
     *
     * @param id SHOP_订单日志ID
     * @return SHOP_订单日志
     */
    @Override
    public ShopOrdersOplog loadShopOrdersOPLog(Integer id) {
        return shopOrdersOPLogDAO.load(id);
    }

    /**
    * 查询所有的SHOP_订单日志，通常有最多取30000条记录的限制
    *
    * @return 所有的SHOP_订单日志，通常有最多取30000条记录的限制
    */
    @Override
    public List<ShopOrdersOplog> queryAllShopOrdersOPLog() {
        return shopOrdersOPLogDAO.queryAll();
    }

    /**
     * 查询SHOP_订单日志
     *
     * @param params 查询参数，为key-value形式
     * @return SHOP_订单日志集合
     */
    @Override
    public List<ShopOrdersOplog> queryShopOrdersOPLog(Map<String, Object> params) {
        return shopOrdersOPLogDAO.query(params);
    }

    /**
     * 查询SHOP_订单日志
     *
     * @param params   查询参数，没有则传null,分页参数key为“sortColumns”
     * @param startRow 起始行数（不含起始行的数据）
     * @param rowSize  要查询记录数
     * @return SHOP_订单日志集合
     */
    @Override
    public List<ShopOrdersOplog> queryShopOrdersOPLog(Map<String, Object> params, int startRow, int rowSize) {
        return shopOrdersOPLogDAO.query(params, startRow, rowSize);
    }

    /**
     * 统计SHOP_订单日志
     *
     * @param params 查询参数，没有则传null,分页参数key为“sortColumns”
     * @return 结果集记录数
     */
    @Override
    public int countShopOrdersOPLog(Map<String, Object> params) {
        return shopOrdersOPLogDAO.count(params);
    }

    /**
     * 查询SHOP_订单日志
     *
     * @param params   查询参数，没有则传null,分页参数key为“sortColumns”
     * @param startRow 起始行数（不含起始行的数据）
     * @param rowSize  要查询记录数
     * @return SHOP_订单日志集合
     */
	@Override
	public List<ShopOrdersOplog> queryOrdersOPLog(Map<String, Object> params,int startRow, int rowSize) {
		return shopOrdersOPLogDAO.query("queryOrdersOPLog", params, startRow, rowSize);
	}

    /**
     * 导出订单日志excel
     *
     * @param params   查询参数，没有则传null,分页参数key为“sortColumns”
     * @return SHOP_订单日志集合
     */
    @Override
    public List<ShopOrdersOplog> queryOrdersOPLog(Map<String, Object> params) {
        return shopOrdersOPLogDAO.query("queryOrdersOPLog", params);
    }
}